package com.example.strategy.strategy;

import com.example.strategy.strategy.service.StrategyReflexService;
import com.example.strategy.strategy.service.StrategyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: chenxiuqi
 * @Date: 2020/4/27 20:32
 * @Description:
 */
@Controller
public class DemoController {

    @Autowired
    private StrategyService strategyService;


    @Autowired
    private StrategyReflexService strategyService2;

    @ResponseBody
    @RequestMapping("play")
    public String play(String type){
        if (type!=null&&!"".equals(type)){
            return strategyService.play(type);
        }else {
            return "要选择一起玩的宠物哟！~";
        }
    }

    @ResponseBody
    @RequestMapping("playReflex")
    public String playReflex(String type){
        if (type!=null&&!"".equals(type)){
            return strategyService2.play(type);
        }else {
            return "要选择一起玩的宠物哟！~";
        }
    }

}
